LoginPanel={};
local this = LoginPanel;


function LoginPanel.New()
    panelMgr:CreatePanel("Login",nil);
end

function LoginPanel.OnCreate(go)
    
end

function LoginPanel.OnClick()
  
   SetPanel.New();
   panelMgr:ClosePanel('Login');
    
end

function LoginPanel.OnBeginClick()
    GamePanel.New();        --进入游戏加载背景
    panelMgr:ClosePanel('Login');
    BattlePanel.New();

end

function LoginPanel.Awake(go)
    log("LoginPanel.Awake");
    this.gameObject=go;
    this.transform=go.transform;
    local behavior = this.transform:GetComponent('LuaBehaviour');
    this. logo = this.transform:Find("Logo"):GetComponent('Image');
    this. begin = this.transform:Find("BeginBtn"):GetComponent('Button');
    this. set = this.transform:Find("SetBtn"):GetComponent('Button');

    -- this.slider=this.transform:Find("Slider").gameObject;
    -- behavior:AddSlider(this.slider,this.OnSliderChange);

this.beginBtn=this.transform:Find("BeginBtn").gameObject;
this.setBtn=this.transform:Find("SetBtn").gameObject;

behavior:AddClick(this.beginBtn,this.OnBeginClick);
behavior:AddClick(this.setBtn,this.OnClick);
end

function LoginPanel.OnSliderChange(value)

    print("value:"..value);
    
end

function LoginPanel.Start()
    log("LoginPanel.Start");
end